package org.iweb.html.impl.js.engine;

import java.io.Serializable;

import org.iweb.html.api.AbstractHtmlElement;
import org.iweb.html.impl.basic.Div;
import org.iweb.html.impl.js.state.HtmlState;
import org.iweb.html.impl.session.MainManager;

public abstract class JavascriptEngine implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1227444867054812375L;

	public abstract JavascriptEngine addClass(AbstractHtmlElement element, String className);
	
	public abstract JavascriptEngine addClassBySelector(String selector, String className);
	
	public abstract JavascriptEngine removeClass(AbstractHtmlElement element, String className);
	
	public abstract JavascriptEngine removeClassBySelector(String selector, String className);
	
	public abstract JavascriptEngine open(AbstractHtmlElement element);
	
	public abstract JavascriptEngine close(AbstractHtmlElement element);
	
	public abstract JavascriptEngine show(AbstractHtmlElement element);
	
	public abstract JavascriptEngine showTemp(AbstractHtmlElement element,long millisec);
	
	public abstract JavascriptEngine hide(AbstractHtmlElement element);
	
	public abstract JavascriptEngine text(AbstractHtmlElement element,String text);
	
	public abstract JavascriptEngine textError(AbstractHtmlElement element,String text);

	public abstract JavascriptEngine replace(AbstractHtmlElement el1, AbstractHtmlElement el2);
	
	public abstract JavascriptEngine append(AbstractHtmlElement el1, AbstractHtmlElement el2);
	
	public abstract JavascriptEngine append(String el, AbstractHtmlElement el2);
	
	public abstract JavascriptEngine html(AbstractHtmlElement el1, AbstractHtmlElement el2);
	
	public abstract JavascriptEngine removeClick(AbstractHtmlElement el1);
	
	public abstract JavascriptEngine textEditor(String text);
	
	public abstract void redirect(String routePath);
	
	
	public HtmlState getHtmlState() {
		//return AppManager.getAppState().getHtmlState();
		return MainManager.getAppSession().getAppState().getHtmlState();
	}
	

	public abstract void openUpload(Div iframeContent);
	
	public abstract void uploadProgress(long bytesRead,long contentLength);

}
